<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基层AI辅助诊断系统 - 医学知识库</title>
    <!-- 引入Element Plus的样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
    <!-- 引入Vue 3 -->
    <script src="https://unpkg.com/vue@3"></script>
    <!-- 引入Element Plus组件库 -->
    <script src="https://unpkg.com/element-plus"></script>
    <!-- 引入中文语言包 -->
    <script src="https://unpkg.com/element-plus/dist/locale/zh-cn.min.js"></script>
    <style>
        /* 基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
            background: #FFFFFF;
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.5;
            margin: 0;
        }

        /* 色彩系统 - 基于HIS系统现代极简风设计规范 */
        :root {
            /* 主色调 */
            --primary: #0F6CBD;
            --primary-light: #D0E7FF;
            --primary-dark: #0A4F8D;
            
            /* 辅助色 */
            --success: #0F8A5F;
            --warning: #F59337;
            --error: #D13438;
            --info: #0078D4;
            
            /* 中性色 - 文字 */
            --text-primary: #1A1A1A;
            --text-secondary: #4D4D4D;
            --text-tertiary: #767676;
            --text-disabled: #A6A6A6;
            
            /* 中性色 - 边框与分割线 */
            --border-strong: #CCCCCC;
            --border-normal: #E0E0E0;
            --border-light: #F0F0F0;
            --divider: #F5F5F5;
            
            /* 中性色 - 背景 */
            --bg-primary: #FFFFFF;
            --bg-secondary: #F9F9F9;
            --bg-card: #FFFFFF;
            --bg-disabled: #F5F5F5;
            
            /* 医疗专业色 */
            --medical-critical: #B91C1C;
            --medical-abnormal: #F59E0B;
            --medical-normal: #10B981;
            --medical-pending: #3B82F6;
            --medical-completed: #9CA3AF;
            
            /* 间距系统 */
            --spacing-2: 2px;
            --spacing-4: 4px;
            --spacing-8: 8px;
            --spacing-12: 12px;
            --spacing-16: 16px;
            --spacing-24: 24px;
            --spacing-32: 32px;
            --spacing-40: 40px;
            --spacing-48: 48px;
            
            /* 字体大小 */
            --font-page-title: 20px;
            --font-card-title: 16px;
            --font-table-title: 14px;
            --font-body: 14px;
            --font-table: 13px;
            --font-small: 12px;
            
            /* 行高 */
            --line-height-title: 1.4;
            --line-height-body: 1.5;
            --line-height-table: 1.2;
            --line-height-form: 1.4;
            
            /* 圆角 */
            --radius-small: 2px;
            --radius-medium: 4px;
            
            /* 动画时间 */
            --transition-fast: 150ms;
            --transition-normal: 200ms;
            --transition-slow: 300ms;
            
            /* 导航统一宽度 */
            --nav-item-width: 140px;
        }

        [v-cloak] {
            display: none;
        }

        /* 布局容器 */
        .container {
            width: 100%;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-color: var(--bg-secondary);
        }

        /* 顶部导航栏 */
        .header {
            height: 60px;
            background-color: var(--bg-primary);
            border-bottom: 1px solid var(--border-normal);
            display: flex;
            align-items: center;
            padding: 0 var(--spacing-24);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            position: relative;
            z-index: 100;
        }

        .header-spacer {
            width: 200px;
            flex-shrink: 0;
        }

        #app-nav {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
            width: calc(100% - 400px); /* 两侧各200px 对称留白 */
            display: flex;
            justify-content: center;
        }
        
        /* Element Plus菜单样式覆盖 */
        .el-menu {
            border: none !important;
            background-color: transparent !important;
        }
        
        .el-menu--horizontal > .el-menu-item,
        .el-menu--horizontal > .el-sub-menu .el-sub-menu__title {
            height: 60px;
            line-height: 60px;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: var(--font-body);
            padding: 0;
            width: var(--nav-item-width);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .el-sub-menu__icon-arrow { display: none !important; }

        .el-menu--horizontal > .el-sub-menu .el-sub-menu__title::after {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            margin-left: 8px;
            background-repeat: no-repeat;
            background-position: center;
            background-size: 16px 16px;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
        }

        .el-sub-menu:hover > .el-sub-menu__title::after,
        .el-sub-menu.is-active > .el-sub-menu__title::after {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230F6CBD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
        }

        .el-sub-menu.is-opened > .el-sub-menu__title::after {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230F6CBD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 15 12 9 18 15'/></svg>");
        }
        
        .el-menu--horizontal > .el-menu-item.is-active,
        .el-menu--horizontal > .el-sub-menu.is-active .el-sub-menu__title {
            color: var(--primary) !important;
            border-bottom: 2px solid var(--primary);
            font-weight: 500;
        }
        
        .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
        .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
        .el-menu--horizontal > .el-sub-menu:not(.is-disabled):hover .el-sub-menu__title {
            color: var(--primary);
            background-color: transparent;
        }
        
        /* 下拉菜单样式覆盖 */
        .el-menu--popup {
            width: var(--nav-item-width) !important;
            min-width: var(--nav-item-width) !important;
            max-width: var(--nav-item-width) !important;
            border-radius: var(--radius-small);
            padding: 4px 0;
            border: 1px solid var(--border-light);
            border-top: 2px solid var(--primary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            text-align: center !important;
        }
        
        .el-menu--popup .el-menu-item {
            height: 36px;
            line-height: 36px;
            padding: 0 !important;
            color: var(--text-secondary);
            white-space: nowrap;
            text-align: center;
            width: var(--nav-item-width) !important;
            box-sizing: border-box;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex !important;
            justify-content: center !important;
            align-items: center !important;
            font-size: var(--font-body);
        }
        
        .el-menu--popup .el-menu-item:hover {
            background-color: var(--bg-secondary);
            color: var(--primary);
        }

        .user-section {
            display: flex;
            align-items: center;
            gap: var(--spacing-16);
            margin-left: auto;
            z-index: 10;
            width: 200px;
            justify-content: flex-end;
            flex-shrink: 0;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: var(--radius-small);
            transition: background-color var(--transition-fast);
            color: var(--text-secondary);
        }

        .user-section:hover {
            background-color: var(--bg-secondary);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background-color: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-weight: 500;
        }

        .user-name {
            font-weight: 500;
            font-size: var(--font-body);
            color: var(--text-secondary);
        }

        .user-arrow {
            color: var(--text-tertiary);
            transition: color var(--transition-normal);
        }

        .user-section:hover .user-arrow {
            color: var(--primary);
        }

        /* 用户下拉弹窗 */
        .user-dropdown {
            position: absolute;
            top: 60px; /* 紧贴头部底部 */
            right: var(--spacing-24);
            width: 160px;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-small);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            display: none;
            z-index: 200;
            overflow: hidden;
        }

        .user-dropdown .item {
            padding: 10px 12px;
            color: var(--text-secondary);
            font-size: var(--font-body);
            cursor: pointer;
            white-space: nowrap;
        }

        .user-dropdown .item:hover {
            background-color: var(--bg-secondary);
            color: var(--primary);
        }

        /* 主要内容区域样式 */
        .main-content {
            padding: 0;
            flex: 1;
            background-color: var(--bg-primary);
            width: 100%;
        }
        
        .content-card {
            width: 100%;
            margin: 0;
            background: var(--bg-primary);
            border: none;
            border-radius: 0;
            box-shadow: none;
            display: flex;
            flex-direction: column;
        }

        /* 页面标题与操作区域样式 */
        .combined-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--spacing-24);
            border-bottom: 1px solid var(--border-light);
            background-color: var(--bg-primary);
        }
        
        .page-title {
            font-size: var(--font-page-title);
            font-weight: 600;
            color: var(--text-primary);
            line-height: var(--line-height-title);
            margin-right: var(--spacing-24);
            white-space: nowrap;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: var(--spacing-16);
        }

        /* 搜索框样式 */
        .search-box {
            position: relative;
            width: 240px;
            height: 32px;
        }
        
        .search-icon {
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
            pointer-events: none;
        }
        
        .search-box input {
            width: 100%;
            height: 100%;
            padding: var(--spacing-8) var(--spacing-8) var(--spacing-8) 32px;
            border: 1px solid var(--border-normal);
            border-radius: var(--radius-small);
            font-size: var(--font-body);
            color: var(--text-primary);
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        
        .search-box input:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.2);
        }
        
        .search-box input::placeholder {
            color: var(--text-tertiary);
        }

        /* 按钮样式 */
        .btn {
            padding: var(--spacing-8) var(--spacing-16);
            border-radius: var(--radius-small);
            font-size: var(--font-body);
            font-weight: 500;
            cursor: pointer;
            border: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all var(--transition-normal);
            gap: var(--spacing-8);
            height: 32px;
            line-height: 1;
        }
        
        .btn .icon {
            flex-shrink: 0;
        }
        
        .btn-primary {
            background-color: var(--primary);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: var(--primary-dark);
        }
        
        .btn-primary:active {
            background-color: var(--primary-dark);
            transform: translateY(1px);
        }
        
        .btn-default {
            background-color: var(--bg-primary);
            color: var(--text-secondary);
            border: 1px solid var(--border-normal);
        }
        
        .btn-default:hover {
            background-color: var(--bg-secondary);
        }
        
        .btn-default:active {
            background-color: var(--bg-secondary);
            transform: translateY(1px);
        }

        /* 操作按钮样式 */
        .action-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: var(--spacing-8);
            padding: var(--spacing-8) var(--spacing-16);
            border-radius: var(--radius-small);
            font-size: var(--font-body);
            font-weight: 500;
            color: var(--text-secondary);
            background-color: transparent;
            border: none;
            cursor: pointer;
            transition: all var(--transition-normal);
            height: 32px;
        }

        .action-btn:hover {
            color: var(--primary);
            background-color: var(--bg-secondary);
        }

        .action-btn:active {
            transform: translateY(1px);
        }

        .action-btn .icon {
            color: var(--text-tertiary);
        }

        .action-btn:hover .icon {
            color: var(--primary);
        }

        /* 搜索历史下拉框样式 */
        .search-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background-color: var(--bg-primary);
            border: 1px solid var(--border-normal);
            border-radius: var(--radius-small);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            margin-top: var(--spacing-4);
            z-index: 100;
            display: none;
        }

        .search-dropdown-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--spacing-8) var(--spacing-12);
            border-bottom: 1px solid var(--border-light);
        }

        .search-dropdown-title {
            font-size: var(--font-small);
            font-weight: 500;
            color: var(--text-secondary);
        }

        .search-dropdown-clear {
            font-size: var(--font-small);
            color: var(--primary);
            cursor: pointer;
            background: none;
            border: none;
            padding: 0;
        }

        .search-dropdown-clear:hover {
            text-decoration: underline;
        }

        .search-dropdown-list {
            max-height: 200px;
            overflow-y: auto;
        }

        .search-dropdown-item {
            padding: var(--spacing-8) var(--spacing-12);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: var(--spacing-8);
        }

        .search-dropdown-item:hover {
            background-color: var(--bg-secondary);
        }

        .search-dropdown-item .item-icon {
            color: var(--text-tertiary);
            flex-shrink: 0;
        }

        .search-dropdown-item .item-text {
            color: var(--text-secondary);
            font-size: var(--font-body);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 分类导航区域样式 */
        .category-nav {
            padding: var(--spacing-24);
            border-bottom: 1px solid var(--border-light);
        }

        .category-tabs {
            display: flex;
            overflow-x: auto;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
            margin-bottom: var(--spacing-16);
            padding-bottom: var(--spacing-4); /* 为滚动条预留空间 */
        }

        .category-tabs::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Opera */
        }

        .category-tab {
            padding: var(--spacing-8) var(--spacing-16);
            border-radius: var(--radius-small);
            font-size: var(--font-body);
            font-weight: 500;
            color: var(--text-secondary);
            background-color: transparent;
            border: none;
            cursor: pointer;
            white-space: nowrap;
            transition: all var(--transition-normal);
        }

        .category-tab:hover {
            color: var(--primary);
            background-color: var(--bg-secondary);
        }

        .category-tab.active {
            color: var(--primary);
            background-color: var(--primary-light);
        }

        /* 文章列表区域样式 */

        .article-list {
            padding: var(--spacing-16);
            display: flex;
            flex-direction: column;
            gap: var(--spacing-16);
        }
        
        /* 表格底部区域 */
        .table-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--spacing-16) var(--spacing-24);
            border-top: 1px solid var(--border-light);
        }

        /* 分页控件样式 */
        .pagination-text {
            color: var(--text-tertiary);
            font-size: var(--font-small);
        }

        .pagination-controls {
            display: flex;
            align-items: center;
            gap: var(--spacing-24);
        }

        .page-numbers {
            display: flex;
            gap: var(--spacing-8);
        }

        .page-numbers button {
            min-width: 32px;
            height: 32px;
            border-radius: var(--radius-small);
            border: 1px solid var(--border-normal);
            background: var(--bg-primary);
            cursor: pointer;
            color: var(--text-secondary);
            transition: all var(--transition-normal);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--font-small);
        }

        .page-numbers button:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .page-numbers button.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #FFFFFF;
        }

        .pagination-size {
            display: flex;
            align-items: center;
            gap: var(--spacing-8);
            color: var(--text-secondary);
            font-size: var(--font-small);
        }

        .page-size-selector {
            height: 32px;
            border: 1px solid var(--border-normal);
            border-radius: var(--radius-small);
            padding: 0 var(--spacing-8);
            font-size: var(--font-small);
            margin: 0 var(--spacing-4);
        }

        .article-card {
            border: 1px solid var(--border-light);
            border-radius: var(--radius-small);
            padding: var(--spacing-16);
            transition: all var(--transition-normal);
            cursor: pointer;
        }

        .article-card:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            border-color: var(--border-normal);
        }

        .article-title {
            font-size: var(--font-card-title);
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: var(--spacing-8);
            line-height: var(--line-height-title);
        }

        .article-meta {
            display: flex;
            gap: var(--spacing-16);
            margin-bottom: var(--spacing-8);
            font-size: var(--font-small);
            color: var(--text-tertiary);
        }

        .article-summary {
            font-size: var(--font-body);
            color: var(--text-secondary);
            line-height: var(--line-height-body);
        }

        /* 响应式样式 */
        @media (max-width: 768px) {
            .header {
                flex-wrap: wrap;
                padding: var(--spacing-12) var(--spacing-16);
                height: auto;
            }
            
            .header-spacer {
                width: 100%;
                justify-content: center;
                margin-bottom: 8px;
            }
            
            .user-section {
                width: 100%;
                justify-content: center;
                order: 3;
                margin-top: 8px;
            }
            
            #app-nav {
                position: relative;
                left: 0;
                transform: none;
                width: 100%;
                order: 3;
                margin-top: var(--spacing-8);
            }
            
            /* Element Plus移动端菜单样式覆盖 */
            .el-menu--collapse {
                width: 100%;
            }
            
            .el-menu--horizontal {
                flex-wrap: wrap;
                width: 100%;
                overflow-x: auto;
                white-space: nowrap;
                -webkit-overflow-scrolling: touch;
                padding-bottom: var(--spacing-4);
                justify-content: center;
            }
            
            .el-menu--horizontal > .el-menu-item,
            .el-menu--horizontal > .el-sub-menu .el-sub-menu__title {
                height: 48px;
                line-height: 48px;
            }
            
            /* 移动端下拉菜单样式 */
            .el-menu--popup {
                position: fixed;
                top: auto !important;
                left: 0 !important;
                right: 0 !important;
                width: 100%;
                max-height: 60vh;
                overflow-y: auto;
                border-radius: 8px 8px 0 0;
            }
            
            .combined-header {
                flex-direction: column;
                align-items: flex-start;
                gap: var(--spacing-16);
            }
            
            .page-title {
                margin-bottom: var(--spacing-8);
            }
            
            .header-actions {
                width: 100%;
                flex-wrap: wrap;
                gap: var(--spacing-12);
            }
            
            .search-box {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div id="app" class="container">
        <!-- 顶部导航栏 - 使用Element Plus组件 -->
        <header class="header">
            <div class="header-spacer"></div>
            <div id="app-nav">
                <el-menu 
                    :default-active="activeIndex" 
                    class="el-menu-demo" 
                    mode="horizontal" 
                    @select="handleSelect"
                    :ellipsis="false"
                    :popper-offset="0"
                    popper-class="custom-dropdown">
                    <el-menu-item index="1">开始问诊</el-menu-item>
                    <el-sub-menu index="2" popper-class="custom-dropdown">
                        <template #title>病历管理</template>
                        <el-menu-item index="2-1">病历查询</el-menu-item>
                        <el-menu-item index="2-2">病历模板</el-menu-item>
                        <el-menu-item index="2-3">个人药品</el-menu-item>
                    </el-sub-menu>
                    <el-menu-item index="3">患者管理</el-menu-item>
                    <el-sub-menu index="4" popper-class="custom-dropdown">
                        <template #title>数据统计</template>
                        <el-menu-item index="4-1">诊断统计</el-menu-item>
                        <el-menu-item index="4-2">宏观统计</el-menu-item>
                    </el-sub-menu>
                    <el-menu-item index="5">医学知识</el-menu-item>
                    <el-sub-menu index="6" popper-class="custom-dropdown">
                        <template #title>基础数据</template>
                        <el-menu-item index="6-1">药品管理</el-menu-item>
                    </el-sub-menu>
                    <el-sub-menu index="7" popper-class="custom-dropdown">
                        <template #title>消息通知</template>
                        <el-menu-item index="7-1">通知查看</el-menu-item>
                        <el-menu-item index="7-2">通知发布</el-menu-item>
                    </el-sub-menu>
                    <el-sub-menu index="8" popper-class="custom-dropdown">
                        <template #title>用户管理</template>
                        <el-menu-item index="8-1">用户管理</el-menu-item>
                        <el-menu-item index="8-2">角色管理</el-menu-item>
                    </el-sub-menu>
                </el-menu>
            </div>
            <div class="user-section" id="userSection">
                <span class="user-name">张医生</span>
                <svg class="user-arrow" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="6 9 12 15 18 9"></polyline>
                </svg>
            </div>
            <div class="user-dropdown" id="userDropdown">
                <div class="item">个人中心</div>
                <div class="item">退出登录</div>
            </div>
        </header>
        <div class="main-content">
            <div class="content-card">
                <!-- 页面标题与操作区域 -->
                <section class="combined-header">
                    <h1 class="page-title">知识库首页</h1>
                    <div class="header-actions">
                        <div class="search-box" id="searchBox">
                            <svg class="search-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <circle cx="11" cy="11" r="8"></circle>
                                <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                            </svg>
                            <input type="text" id="searchInput" placeholder="输入疾病名称、症状等关键词">
                            
                            <!-- 搜索历史下拉框 -->
                            <div class="search-dropdown" id="searchDropdown">
                                <div class="search-dropdown-header">
                                    <span class="search-dropdown-title">搜索历史</span>
                                    <button class="search-dropdown-clear" id="clearSearchHistory">清空历史</button>
                                </div>
                                <div class="search-dropdown-list" id="searchHistoryList">
                                    <!-- 搜索历史项将通过JavaScript动态生成 -->
                                </div>
                            </div>
                        </div>
                        
                        <button class="action-btn" id="collectionsBtn">
                            <svg class="icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>
                            </svg>
                            我的收藏
                        </button>
                        
                        <button class="action-btn" id="historyBtn">
                            <svg class="icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <circle cx="12" cy="12" r="10"></circle>
                                <polyline points="12 6 12 12 16 14"></polyline>
                            </svg>
                            浏览历史
                        </button>
                        
                        <button class="action-btn" id="aiChatBtn">
                            <svg class="icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
                            </svg>
                            AI问答
                        </button>
                    </div>
                </section>
                
                <!-- 分类导航区域 -->
                <section class="category-nav">
                    <div class="category-tabs" id="categoryTabs">
                        <!-- 分类标签将通过JavaScript动态生成 -->
                    </div>
                    
                    <div class="article-list" id="articleList">
                        <!-- 文章列表将通过JavaScript动态生成 -->
                    </div>
                    
                    <!-- 分页控件 -->
                    <div class="table-footer">
                        <div class="pagination-text" id="summaryText">共 <span id="totalArticles">20</span> 条记录</div>
                        <div class="pagination-controls">
                            <div id="pageNumbers" class="page-numbers">
                                <button class="active">1</button>
                                <button>2</button>
                                <button>3</button>
                                <button>4</button>
                                <button>5</button>
                            </div>
                            <div class="pagination-size">
                                每页显示
                                <select id="pageSizeSelector" class="page-size-selector">
                                    <option value="10">10</option>
                                    <option value="20">20</option>
                                    <option value="50">50</option>
                                </select>
                                条
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
    
    <!-- JavaScript 交互逻辑 -->
    <script>
        // 创建Vue应用
        document.addEventListener('DOMContentLoaded', function() {
            const { createApp, ref } = Vue;
            
            // 创建导航菜单Vue应用
            const navApp = createApp({
                setup() {
                    const activeIndex = ref('5'); // 默认选中"医学知识"
                    
                    const handleSelect = (key, keyPath) => {
                        console.log(key, keyPath);
                        // 这里可以添加导航逻辑，如页面跳转等
                    };
                    
                    return {
                        activeIndex,
                        handleSelect
                    };
                }
            });
            
            // 使用Element Plus
            navApp.use(ElementPlus, {
                locale: ElementPlusLocaleZhCn
            });
            
            // 挂载Vue应用
            navApp.mount('#app-nav');

            // 用户下拉菜单
            const userSection = document.getElementById('userSection');
            const userDropdown = document.getElementById('userDropdown');
            
            if (userSection && userDropdown) {
                userSection.addEventListener('click', function(e) {
                    e.stopPropagation();
                    const isOpen = userDropdown.style.display === 'block';
                    userDropdown.style.display = isOpen ? 'none' : 'block';
                });

                document.addEventListener('click', function() {
                    userDropdown.style.display = 'none';
                });
            }

            // 搜索框和搜索历史
            const searchBox = document.getElementById('searchBox');
            const searchInput = document.getElementById('searchInput');
            const searchDropdown = document.getElementById('searchDropdown');
            const searchHistoryList = document.getElementById('searchHistoryList');
            const clearSearchHistory = document.getElementById('clearSearchHistory');
            
            // 模拟搜索历史数据
            let searchHistory = ['高血压', '糖尿病', '感冒', '头痛', '胃炎'];
            
            // 渲染搜索历史
            function renderSearchHistory() {
                searchHistoryList.innerHTML = '';
                searchHistory.forEach(item => {
                    const historyItem = document.createElement('div');
                    historyItem.className = 'search-dropdown-item';
                    historyItem.innerHTML = `
                        <span class="item-text">${item}</span>
                    `;
                    historyItem.addEventListener('click', function() {
                        searchInput.value = item;
                        searchDropdown.style.display = 'none';
                        // 执行搜索
                        performSearch(item);
                    });
                    searchHistoryList.appendChild(historyItem);
                });
            }
            
            // 清空搜索历史
            clearSearchHistory.addEventListener('click', function(e) {
                e.stopPropagation();
                searchHistory = [];
                renderSearchHistory();
            });
            
            // 点击搜索框显示历史记录
            searchInput.addEventListener('click', function(e) {
                e.stopPropagation();
                searchDropdown.style.display = 'block';
            });
            
            // 点击页面其他区域隐藏历史记录
            document.addEventListener('click', function() {
                searchDropdown.style.display = 'none';
            });
            
            // 阻止点击下拉框本身导致的关闭
            searchDropdown.addEventListener('click', function(e) {
                e.stopPropagation();
            });
            
            // 搜索功能
            function performSearch(keyword) {
                if (keyword.trim()) {
                    alert(`执行搜索：${keyword}`);
                    // 将搜索词添加到历史记录
                    if (!searchHistory.includes(keyword)) {
                        searchHistory.unshift(keyword);
                        if (searchHistory.length > 5) {
                            searchHistory.pop();
                        }
                        renderSearchHistory();
                    }
                }
            }
            
            // 回车键搜索
            searchInput.addEventListener('keypress', function(e) {
                if (e.key === 'Enter') {
                    const keyword = searchInput.value.trim();
                    performSearch(keyword);
                }
            });

            // 分类导航
            const categoryTabs = document.getElementById('categoryTabs');
            const articleList = document.getElementById('articleList');
            const pageNumbersEl = document.getElementById('pageNumbers');
            const pageSizeSelector = document.getElementById('pageSizeSelector');
            const totalArticlesEl = document.getElementById('totalArticles');
            
            // 分类数据
            const categories = [
                { id: 'common', name: '常见病诊疗', active: true },
                { id: 'chronic', name: '慢病管理', active: false },
                { id: 'emergency', name: '急诊急救', active: false },
                { id: 'maternal', name: '妇幼保健', active: false },
                { id: 'medication', name: '基本用药', active: false },
                { id: 'vaccination', name: '预防接种', active: false },
                { id: 'education', name: '健康教育', active: false },
                { id: 'tcm', name: '中医适宜技术', active: false }
            ];
            
            // 分页状态
            let pageSize = 10;
            let currentPage = 1;
            
            // 文章数据
            const articleData = {
                common: [
                    {
                        title: '《基层医疗机构常见呼吸道感染诊疗指南》',
                        date: '2025-09-15',
                        source: '国家基层医疗卫生机构管理中心',
                        summary: '针对基层常见的上呼吸道感染、支气管炎等疾病的诊断和治疗...'
                    },
                    {
                        title: '《基层常见消化系统疾病诊疗指南》',
                        date: '2025-08-25',
                        source: '中华医学会消化病学分会',
                        summary: '针对胃炎、消化不良、腹泻等基层常见消化系统疾病的诊疗方案...'
                    },
                    {
                        title: '《基层常见皮肤病诊疗指南》',
                        date: '2025-08-10',
                        source: '中国皮肤科医师协会',
                        summary: '针对湿疹、皮炎、痤疮等基层常见皮肤病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层常见骨关节疾病诊疗指南》',
                        date: '2025-07-20',
                        source: '中华医学会骨科学分会',
                        summary: '针对骨关节炎、腰背痛等基层常见骨科疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层常见头痛诊疗指南》',
                        date: '2025-07-05',
                        source: '中华神经科学会',
                        summary: '针对偏头痛、紧张性头痛等基层常见头痛的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见眼科疾病诊疗指南》',
                        date: '2025-06-28',
                        source: '中华眼科学会',
                        summary: '针对结膜炎、干眼症等基层常见眼科疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见耳鼻喉疾病诊疗指南》',
                        date: '2025-06-15',
                        source: '中华耳鼻咽喉头颈外科学会',
                        summary: '针对中耳炎、鼻炎等基层常见耳鼻喉疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见口腔疾病诊疗指南》',
                        date: '2025-06-05',
                        source: '中华口腔医学会',
                        summary: '针对龋齿、牙周炎等基层常见口腔疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见泌尿系统疾病诊疗指南》',
                        date: '2025-05-20',
                        source: '中华泌尿外科学会',
                        summary: '针对尿路感染、前列腺疾病等基层常见泌尿系统疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见妇科疾病诊疗指南》',
                        date: '2025-05-10',
                        source: '中华妇产科学会',
                        summary: '针对阴道炎、月经不调等基层常见妇科疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见儿科疾病诊疗指南》',
                        date: '2025-05-01',
                        source: '中华儿科学会',
                        summary: '针对小儿发热、腹泻等基层常见儿科疾病的诊断和治疗方案...'
                    },
                    {
                        title: '《基层医疗机构常见老年病诊疗指南》',
                        date: '2025-04-20',
                        source: '中华老年医学会',
                        summary: '针对老年人常见疾病的诊断和治疗方案，包括老年综合征评估...'
                    }
                ],
                chronic: [
                    {
                        title: '《2025年高血压诊疗指南更新》',
                        date: '2025-09-15',
                        source: '中国高血压联盟',
                        summary: '本指南更新了高血压诊断标准和治疗方案，强调基层医疗机构的管理策略...'
                    },
                    {
                        title: '《基层医疗机构糖尿病规范化管理指南》',
                        date: '2025-08-20',
                        source: '中华医学会内分泌学分会',
                        summary: '针对基层医疗机构糖尿病患者的筛查、诊断、治疗和随访管理...'
                    },
                    {
                        title: '《基层医疗机构慢性阻塞性肺疾病管理指南》',
                        date: '2025-07-15',
                        source: '中华医学会呼吸病学分会',
                        summary: '针对基层医疗机构COPD患者的筛查、诊断、治疗和随访管理...'
                    },
                    {
                        title: '《基层医疗机构冠心病规范化管理指南》',
                        date: '2025-06-10',
                        source: '中华医学会心血管病学分会',
                        summary: '针对基层医疗机构冠心病患者的筛查、诊断、治疗和随访管理...'
                    },
                    {
                        title: '《基层医疗机构脑卒中规范化管理指南》',
                        date: '2025-05-25',
                        source: '中华医学会神经病学分会',
                        summary: '针对基层医疗机构脑卒中患者的筛查、诊断、治疗和随访管理...'
                    },
                    {
                        title: '《基层医疗机构慢性肾脏病规范化管理指南》',
                        date: '2025-04-20',
                        source: '中华医学会肾脏病学分会',
                        summary: '针对基层医疗机构CKD患者的筛查、诊断、治疗和随访管理...'
                    },
                    {
                        title: '《基层医疗机构骨质疏松症规范化管理指南》',
                        date: '2025-03-15',
                        source: '中华医学会骨质疏松和骨矿盐疾病分会',
                        summary: '针对基层医疗机构骨质疏松症患者的筛查、诊断、治疗和随访管理...'
                    }
                ],
                emergency: [
                    {
                        title: '《基层医疗机构急诊常见病症处理指南》',
                        date: '2025-09-10',
                        source: '中华医学会急诊医学分会',
                        summary: '针对基层医疗机构常见急诊情况的初步处理和转诊标准...'
                    },
                    {
                        title: '《基层医疗机构心肺复苏操作规范》',
                        date: '2025-08-05',
                        source: '中国心肺复苏指南编写组',
                        summary: '针对基层医疗机构心脏骤停患者的现场急救和心肺复苏操作流程...'
                    },
                    {
                        title: '《基层医疗机构急性胸痛处理流程》',
                        date: '2025-07-20',
                        source: '中华医学会心血管病学分会',
                        summary: '针对基层医疗机构急性胸痛患者的鉴别诊断和初步处理流程...'
                    },
                    {
                        title: '《基层医疗机构急性腹痛处理流程》',
                        date: '2025-06-15',
                        source: '中华医学会外科学分会',
                        summary: '针对基层医疗机构急性腹痛患者的鉴别诊断和初步处理流程...'
                    },
                    {
                        title: '《基层医疗机构高热惊厥处理流程》',
                        date: '2025-05-10',
                        source: '中华医学会儿科学分会',
                        summary: '针对基层医疗机构小儿高热惊厥的紧急处理和转诊标准...'
                    },
                    {
                        title: '《基层医疗机构急性过敏反应处理流程》',
                        date: '2025-04-25',
                        source: '中华医学会变态反应学分会',
                        summary: '针对基层医疗机构急性过敏反应和过敏性休克的紧急处理流程...'
                    }
                ]
            };
            
            // 渲染分类标签
            function renderCategoryTabs() {
                categoryTabs.innerHTML = '';
                categories.forEach(category => {
                    const tab = document.createElement('button');
                    tab.className = `category-tab ${category.active ? 'active' : ''}`;
                    tab.textContent = category.name;
                    tab.dataset.id = category.id;
                    tab.addEventListener('click', function() {
                        // 更新激活状态
                        categories.forEach(c => c.active = false);
                        category.active = true;
                        renderCategoryTabs();
                        
                        // 不再需要更新分类标题
                        
                        // 渲染对应分类的文章列表
                        renderArticles(category.id);
                    });
                    categoryTabs.appendChild(tab);
                });
            }
            
            // 渲染分页控件
            function renderPagination(totalItems) {
                const totalPages = Math.ceil(totalItems / pageSize);
                
                // 更新总记录数
                totalArticlesEl.textContent = totalItems;
                
                // 渲染页码按钮
                pageNumbersEl.innerHTML = '';
                
                // 计算需要显示的页码范围
                let startPage = Math.max(1, currentPage - 2);
                let endPage = Math.min(totalPages, startPage + 4);
                
                // 调整起始页，确保显示5个页码
                if (endPage - startPage < 4 && totalPages > 4) {
                    startPage = Math.max(1, endPage - 4);
                }
                
                // 创建页码按钮
                for (let i = startPage; i <= endPage; i++) {
                    const pageBtn = document.createElement('button');
                    pageBtn.textContent = i;
                    pageBtn.className = i === currentPage ? 'active' : '';
                    pageBtn.addEventListener('click', () => {
                        currentPage = i;
                        const activeCategory = categories.find(c => c.active);
                        if (activeCategory) {
                            renderArticles(activeCategory.id);
                        }
                    });
                    pageNumbersEl.appendChild(pageBtn);
                }
            }
            
            // 渲染文章列表
            function renderArticles(categoryId) {
                articleList.innerHTML = '';
                const articles = articleData[categoryId] || [];
                
                if (articles.length === 0) {
                    const emptyMessage = document.createElement('div');
                    emptyMessage.style.padding = '24px';
                    emptyMessage.style.textAlign = 'center';
                    emptyMessage.style.color = 'var(--text-tertiary)';
                    emptyMessage.textContent = '暂无相关文章';
                    articleList.appendChild(emptyMessage);
                    
                    // 更新分页信息
                    renderPagination(0);
                    return;
                }
                
                // 计算当前页的文章
                const start = (currentPage - 1) * pageSize;
                const end = Math.min(start + pageSize, articles.length);
                const pageArticles = articles.slice(start, end);
                
                // 渲染当前页的文章
                pageArticles.forEach(article => {
                    const articleCard = document.createElement('div');
                    articleCard.className = 'article-card';
                    articleCard.innerHTML = `
                        <h3 class="article-title">${article.title}</h3>
                        <div class="article-meta">
                            <span>发布日期: ${article.date}</span>
                            <span>来源: ${article.source}</span>
                        </div>
                        <p class="article-summary">摘要: ${article.summary}</p>
                    `;
                    articleCard.addEventListener('click', function() {
                        alert(`查看文章详情：${article.title}`);
                    });
                    articleList.appendChild(articleCard);
                });
                
                // 更新分页信息
                renderPagination(articles.length);
            }
            
            // 操作按钮事件
            document.getElementById('collectionsBtn').addEventListener('click', function() {
                alert('跳转到我的收藏页面');
            });
            
            document.getElementById('historyBtn').addEventListener('click', function() {
                alert('跳转到浏览历史页面');
            });
            
            document.getElementById('aiChatBtn').addEventListener('click', function() {
                alert('跳转到AI问答页面');
            });
            
            // 每页显示数量选择器事件
            pageSizeSelector.addEventListener('change', function() {
                pageSize = parseInt(pageSizeSelector.value);
                currentPage = 1; // 重置为第一页
                const activeCategory = categories.find(c => c.active);
                if (activeCategory) {
                    renderArticles(activeCategory.id);
                }
            });
            
            // 初始化
            renderSearchHistory();
            renderCategoryTabs();
            renderArticles('common');
        });
    </script>
</body>
</html>
